package com.firewolf.rabbitmq;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;

import utils.ConnectionUtils;

public class NewTask {
	private static final String QUEUE_NAME = "work_queue2";

	public static void main(String[] args) throws Exception {

		Connection conn = ConnectionUtils.getMQConnection();

		Channel channel = conn.createChannel();

		channel.queueDeclare(QUEUE_NAME, false, false, false, null);

		for (int i = 0; i < 20; i++) {
			String msg = "Hello, "+i;
			channel.basicPublish("", QUEUE_NAME, null, msg.getBytes());
		}
		
	}
}
